package com.example.xiaohei.ui.adapter

import android.util.Log
import androidx.databinding.ViewDataBinding
import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder
import com.example.xiaohei.R
import com.example.xiaohei.base.BaseAdapter
import com.example.xiaohei.base.BaseBean
import com.example.xiaohei.base.BaseDataBindingAdapter
import com.example.xiaohei.bean.Province
import com.example.xiaohei.databinding.ItemproBinding1

class MyAdapter : BaseAdapter(R.layout.itempro1) {

    override fun convert(holder: BaseDataBindingHolder<ViewDataBinding>, item: BaseBean) {
        holder.dataBinding?.let {
            //不是特别优雅，就很难受
            it as ItemproBinding1
            item as Province

            it.tvName?.text = item.provinceName
            it.executePendingBindings()
        }
    }

}